function mountain:gen/init/rotate
function mountain:gen/common/rnd/random

execute if score result mt_random matches 0..1 at @e[tag=mt_center] as @e[tag=mt_center] run summon armor_stand ^ ^-7 ^3 {NoGravity: 1b, Tags: ["mt_gen_new", "mt_gen"]}
execute if score result mt_random matches 2..3 at @e[tag=mt_center] as @e[tag=mt_center] run summon armor_stand ^ ^-7 ^4 {NoGravity: 1b, Tags: ["mt_gen_new", "mt_gen"]}
execute if score result mt_random matches 4..5 at @e[tag=mt_center] as @e[tag=mt_center] run summon armor_stand ^ ^-8 ^5 {NoGravity: 1b, Tags: ["mt_gen_new", "mt_gen"]}
execute if score result mt_random matches 6..7 at @e[tag=mt_center] as @e[tag=mt_center] run summon armor_stand ^ ^-8 ^6 {NoGravity: 1b, Tags: ["mt_gen_new", "mt_gen"]}
execute if score result mt_random matches 8..9 at @e[tag=mt_center] as @e[tag=mt_center] run summon armor_stand ^ ^-10 ^7 {NoGravity: 1b, Tags: ["mt_gen_new", "mt_gen"]}
execute if score result mt_random matches 10..11 at @e[tag=mt_center] as @e[tag=mt_center] run summon armor_stand ^ ^-10 ^8 {NoGravity: 1b, Tags: ["mt_gen_new", "mt_gen"]}

scoreboard players operation @e[tag=mt_gen_new,limit=1] mt_index = cur mt_index
scoreboard players operation @e[tag=mt_gen_new,limit=1] mt_layer = cur mt_layer

scoreboard players add cur mt_index 1

# 调整方向
execute as @e[tag=mt_gen_new] run execute at @s run tp @s ~ ~ ~ facing entity @e[tag=mt_center,limit=1] eyes
execute as @e[tag=mt_gen_new] run execute at @s run tp @s ~ ~ ~ ~180 0
# 赋值遗传算法
function mountain:gen/common/rnd/random
execute if score result mt_random matches 0..5 run scoreboard players set @e[tag=mt_gen_new] mt_gen_type 0
execute if score result mt_random matches 6..11 run scoreboard players set @e[tag=mt_gen_new] mt_gen_type 1

tag @e[tag=mt_gen_new] remove mt_gen_new

execute if score cur mt_index < init_max mt_index run function mountain:gen/init/summon